/****************************************
Header name: Manip.h
Author: Gu Zhengxiong
Version: 2013.11.21
Description:The header defines a structure, MANIP.
****************************************/

# include "StudentInfo.h"
# include "StudentGrade.h"
# include "Student.h"

# ifndef STUDENT_MANAGEMENT_MANIP_H
# define STUDENT_MANAGEMENT_MANIP_H

# define ALL_INFO_FORMAT "%s %s %s %d\n"
# define ALL_INFO_PARA ps_tmp->pi->number, ps_tmp->pi->name, ps_tmp->pi->address, ps_tmp->pi->age
# define ALL_GRADE_FORMAT "%s %s %d %d %d\n"
# define ALL_GRADE_PARA ps_tmp->pi->number, ps_tmp->pi->name, ps_tmp->pg->maths, ps_tmp->pg->clang, ps_tmp->pg->english

typedef struct _Manip
{
	PSTUDENT phead, ptail;//new, but hard to achieve
	PSTUDENT (*Construct) (void);
	void (*DisplayInfo)(PSTUDENT);
	void (*DisplayGrade) (PSTUDENT);
	void (*Add) (PSTUDENT, PINFO, PGRADE);
	PSTUDENT (*Inquire) (PSTUDENT, int, char *);
	void (*Destroy) (PSTUDENT);
	/* To be comtinued.... */
}
MANIP,
*PMANIP;

PMANIP
ManipInitialize (void);
PSTUDENT
Construct (void);
void
DisplayInfo (PSTUDENT phead);
void
DisplayGrade (PSTUDENT phead);
void
Add (PSTUDENT phead, PINFO pi, PGRADE pg);
PSTUDENT
Inquire (PSTUDENT phead, int type, char * s);
void
Destroy (PSTUDENT ps);
/* To be continued.... */

# endif